
#include "components_cpp/number_publisher.hpp"

my_namespace::NumberPubNode::NumberPubNode(const rclcpp::NodeOptions &options): Node("number_pub_node", options)
{
    // this->get_node_base_interface();

    publisher_ = this->create_publisher<std_msgs::msg::Int64>("number", 10);
    timer_ = this->create_wall_timer(
        1s, std::bind(&NumberPubNode::publish_number, this));

    RCLCPP_INFO(this->get_logger(), "Number publisher has been started.");
}


void my_namespace::NumberPubNode::publish_number()
{
    auto message = std_msgs::msg::Int64();
    message.data = count;

    publisher_->publish(message);
    count ++;
}
